<template>
  <view class="qjbox">
    <view class="rk-box"></view>
    <view class="cov-box">
      <view class="">
        <image src="../../static/logo.jpg" class="img"></image>
        <div class="imgText">星辰大海</div>
      </view>
      <view class="gobox">
        <view class="go" @click="tokongjian">私人空间</view>
        <view class="go1" @click="tophoto">星辰相册</view>
      </view>
    </view>
  </view>
</template>

<script>
  import {gettoken} from '../../utils/getToken.js'
  export default {
    data() {
      return {
        token: '',
      };
    },
    onLoad() {
      this.token = uni.getStorageSync('token') || ''
      if(this.token == '')
      gettoken(this)
    },
    methods:{
      tophoto(){
        wx.navigateTo({
          url:'/subpkg/photo/photo'
        })
      },
      tokongjian(){
        if(this.token == '')setTimeout(()=>{},1500)
        // 权限判断
        uni.$req.req(this, 'tokentest',{'token':this.token}).then((res)=>{
           const { bool } = res.result
           if(bool){
               wx.navigateTo({
                 url:'/subpkg/my-kj/my-kj'
               })
           }else{
                   	return  uni.showModal({
                   	      		title: '提示',
                   	      		showCancel:false,
                   	      		content: "权限不足",
                   	      		
                   	      })
           }
          })
        // if(this.token== 'omF4l43QnV18tf0azajVHFQElWf4')
        // {
        //   wx.navigateTo({
        //     url:'/subpkg/my-kj/my-kj'
        //   })
        // }
        // else return  uni.showModal({
        //       		title: '提示',
        //       		showCancel:false,
        //       		content: "权限不足",
              		
        //       })
      }
    }
  }
</script>

<style lang="scss">
  .qjbox{
    overflow: hidden;
  }
.rk-box{
  height: 100vh;
  width: 100vw;
  background: url('https://mp-8f25c430-0372-4755-96cf-2bd45756f60a.cdn.bspapp.com/cloudstorage/0e7a8d8a-c758-429e-af8f-70207c09854b.jpg') no-repeat center 0px;
  filter: blur(5px);
  background-position: center 0px;
  background-size: cover;
  transform: scale(1.15);
 
}
  .cov-box{
  width: 700rpx;
  height: 20vh;
  position: absolute;
  box-sizing: border-box;
  left: 20rpx;
  box-shadow: 0 0 3px 5px rgba(230, 230, 230, 0.8);
  top: 40vh;
  background: rgba(135, 135, 135, 0.3);
  border-radius: 8px;
  display: flex;
  padding-left: 20px;
  align-items: center;
  
 .imgText{
   text-align: center;
   color: #fff;
   margin-top: 10px;
 }
  
  .img{
    border-radius: 50%;
    width: 80px;
    box-shadow: 0 0 2px 3px #eee;
    height: 80px;
  }
  .gobox{
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .go{
    width: 50%;
    height: 40px;
    border-bottom: 2px solid #fff;
    text-align: center;
    font-size: 25px;
      text-shadow:0px 1px 0px #c0c0c0,
    	 0px 2px 0px #b0b0b0,
    	 0px 3px 0px #a0a0a0,
    	 0px 4px 0px #909090,
    	 0px 5px 10px rgba(0, 0, 0, .9);
       letter-spacing: 5px;
    font-weight: bold;
    color: #eee;
  }
  .go1{
    width: 50%;
    height: 40px;
    text-align: center;
    font-size: 25px;
      text-shadow:0px 1px 0px #c0c0c0,
    	 0px 2px 0px #b0b0b0,
    	 0px 3px 0px #a0a0a0,
    	 0px 4px 0px #909090,
    	 0px 5px 10px rgba(0, 0, 0, .9);
       letter-spacing: 5px;
    font-weight: bold;
    color: #eee;
  }

  }
  .cov-box::before{
    content: ' ';
    position: absolute;
    right: 80rpx;
    top: -15vh;
    width: 300rpx;
    height: 300rpx;
    background: url('https://mp-8f25c430-0372-4755-96cf-2bd45756f60a.cdn.bspapp.com/cloudstorage/0e7a8d8a-c758-429e-af8f-70207c09854b.jpg') no-repeat center 0px;
    background-size: cover;
    border-radius: 20px;
    box-shadow: 0 0 20px 2px #4c4b4b;
  }
</style>
